package com.hut.oa.model.bean;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * 报销申请表
 * @author 熊涛
 *
 */
@Entity
@Table(name="apply_account")
public class ApplyAccount {

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="aa_id")
	private Long id;//报销申请表
	
	@Column(name="aa_reason",nullable=false)
	private String reason;//报销事由
	
	@Column(name="aa_money",nullable=false)
	private Double money;//报销金额
	
	@Column(name="aa_time",nullable=false)
	private Date time;//报销日期
	
	@Column(name="aa_document",nullable=false)
	private String document;//单据图
	
	@JoinColumn(name="aa_apply_id",nullable=false)
	@OneToOne(cascade=CascadeType.ALL)
	private Apply apply;//通用申请
	
	public ApplyAccount() {}
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public Double getMoney() {
		return money;
	}

	public void setMoney(Double money) {
		this.money = money;
	}

	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}

	public String getDocument() {
		return document;
	}

	public void setDocument(String document) {
		this.document = document;
	}

	public Apply getApply() {
		return apply;
	}

	public void setApply(Apply apply) {
		this.apply = apply;
	}

	@Override
	public String toString() {
		return "ApplyAccount [id=" + id + ", reason=" + reason + ", money=" + money + ", time=" + time + ", document="
				+ document + "]";
	}

}
